package com.gs.weather.controller;

import com.gs.weather.service.ViewWidgetService;
import com.gs.weather.vo.LinkageFrameVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Legolas
 * Date: 2017/10/16 0016
 */
@Controller
@RequestMapping(value = "widget")
public class ViewWidgetController {

    @Autowired
    ViewWidgetService viewWidgetService;

    @RequestMapping("linkageTypeName")
    @ResponseBody
    public List<LinkageFrameVO> getTypeName(){
        return viewWidgetService.queryAllTypeName();
    }

    @RequestMapping("linkageSubtypeName")
    @ResponseBody
    public List<LinkageFrameVO> getSubtypeName(Integer id){
        return viewWidgetService.queryAllSubtypeNameByTypeId(id);
    }

    @RequestMapping("linkageStrengthLevel")
    @ResponseBody
    public List<LinkageFrameVO> getStrengthLevel(Integer id){
        return viewWidgetService.queryAllStrengthLevelBySubtypeId(id);
    }
}
